<!-- 绑定手机 -->
<template>
  <div class="phone">
    <van-nav-bar fixed title="预警记录" safe-area-inset-top>
      <template #left>
        <img style="width: 30px; margin-right: 10px" src="../../assets/images/返回2.png" @click="() => $router.go(-1)"
          alt="" />

      </template>
    </van-nav-bar>
    <van-cell-group v-for="item in list" v-bind:key="item.id">
      <van-cell>
        <p>预警类别：{{ getValue(item.type)}}</p>
        <p>预警内容：{{item.content}}</p>
        <p>预警池塘：{{item.areaname}}</p>
        <p>预警时间：{{item.createtime}}</p>
      </van-cell>

    </van-cell-group>


  </div>
</template>

<script>

import { logList } from "../../api/fazhi";
export default {
  name: "",
  data() {
    return {
      list: []
    };
  },
  methods: {
    async getData() {


      let res = await logList({ userid: localStorage.getItem("userid") });
      if (res.status == 200) {
        this.list = res.data;
      }
    },
    getValue(item) {
      if (item == "Dissox") {
        return "溶解氧饱和度";
      } else if (item == "Dissoxcon") {
        return "溶解氧浓度";
      } else if (item == "Temp") {
        return "水温"
      } else if (item == "Ph") {
        return "水质Ph";
      } else if (item == "Phtemp") {
        return "Ph计水温"
      } else if (item == "Anitent") {
        return "氨氮含量"
      } else if (item == "Nitrite") {
        return "亚硝酸根含量"
      } else if (item == "AnitentPh") {
        return "氨氮Ph";
      } else {
        return "未知";
      }
    }

  },
  computed: {},
  watch: {},
  created() {

    this.getData();
  },
  mounted() { },
};
</script>

<style lang="scss" scoped>
.phone {
  width: 100%;
  padding-top: 92px;

  .totip {
    padding: 20px 30px;
    font-size: 30px;
    color: #ccc;
    display: flex;

    > :first-child {
      font-size: 40px;
      color: red;
      margin-right: 10px;
    }
  }

  .btn {
    width: 100%;
    text-align: center;
    position: fixed;
    bottom: 10%;
  }
}
</style>